#!/usr/bin/env bash

# set cwd to current file path
echo "---pwd: $(pwd)"
#root_filepath="$(pwd)/$0"

if [[ $0 = /* ]]; then root_filepath="$0"; else root_filepath="$(pwd)/$0"; fi;

echo "~~~ root_filepath: $root_filepath"

root_dirpath=$(dirname -- $root_filepath)
cd $root_dirpath

# install packages
pip install bdtime flask

# kill old thread with 5000 port
# PYTHONIOENCODING=utf-8 python pykillport.py 80
python pykillport.py 80

# run python program
# PYTHONIOENCODING=utf-8 python myflask.py -p 80
python myflask.py -p 80



